<?php

namespace Inter\ArticleBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class UserType extends AbstractType
{
    /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
         $builder->add('userName', 'text', 
         		array(            			
            			'label'  => 'User Name',
            			'attr' => array('class' => 'form-control'),
            			'label_attr' => array('class' => 'col-lg-2 control-label'),
        			));
         $builder->add('email', 'email', 
         		array(            			
            			'label'  => 'Email',
            			'attr' => array('class' => 'form-control'),
            			'label_attr' => array('class' => 'col-lg-2 control-label'),
        			));
         $builder->add('password', 'repeated', 
         		array(
		               'first_name' => 'first',
						'second_name' => 'second',
						'type' => 'password',
         				'label_attr' => array('class' => 'col-lg-2 control-label'),
		        ));
        
    }
    
    /**
     * @param OptionsResolverInterface $resolver
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'Inter\ArticleBundle\Entity\User'
        ));
    }

    /**
     * @return string
     */
    public function getName()
    {
        return 'inter_articlebundle_user';
    }
}
